package cn.com.open.itembank.dto;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by lucky on 2018/1/9.
 */
public class RulePartInputModel extends RulePartModel {
    public RulePartInputModel() {
        this.sections = null;
    }

    /**
     * 大题列表
     */
    private List<RuleSectionInputModel> sections;

    /**
     * Gets section list.
     *
     * @return the section list
     */
    public List<RuleSectionInputModel> getSections() {
        if (sections == null) {
            sections = new ArrayList<>();
        }

        return sections;
    }

    /**
     * Copy to save rule part save model.
     *
     * @return the rule part save model
     */
    public RulePartSaveModel copyToSave() {
        RulePartSaveModel model = new RulePartSaveModel();
        model.setCheckTime(this.getCheckTime());
        model.setMaxTime(this.getMaxTime());
        model.setMinTime(this.getMinTime());
        model.setExpectedTime(this.getExpectedTime());
        model.setListening(this.isListening());
        model.getInstruction().addAll(this.getInstruction());
        return model;
    }
}
